package redis

import (
	"fmt"
	"github.com/redis/go-redis/v9"
	"web-server/config"
)

func GetDB() redis.Cmdable {
	var RDB redis.Cmdable
	redisConfig := config.AllConfig.Redis
	RDB = redis.NewClient(&redis.Options{
		Addr:     fmt.Sprintf("%s:%d", redisConfig.Host, redisConfig.Port),
		Password: redisConfig.Password,
		DB:       redisConfig.DB,
	})
	return RDB
}
